<!doctype html>
<html class="no-js">
<#include "../../common/header.ftl">
<#include "../../common/common-css.ftl">
<#include "../../common/common-js.ftl"> 
<script src="${basePath}/js/groupGoods/edit.js?v=201711021700"></script>
<head>
<link rel="stylesheet" href="${basePath}/css/global.css" media="all">
<script type="text/javascript" src="${basePath}/js/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}/js/jquery.easyui.min.1.2.2.js"></script>
<script type="text/javascript">
 var imgUrl = "${imgUrl}";
</script>
<meta charset="UTF-8">
<title>组货编辑页</title>
<style type="text/css">
body{
  		overflow: auto; 
  	}
th {
	width: 100px;
	height: 20px;
}
}
</style>
</head>
<body>
	<div class="admin-content-body">
		<div class="am-g">
			<div class="am-u-sm-12">
				<div>
					<table class="am-table">
						<tr>
							<td>
								<form class="am-form" role="form">
									<div>
									<button  type="button" class="am-btn am-btn-primary" id="btnSaveGoods" name ="btnSaveGoods" onclick="saveGroupGoodsInfo()">保存</button>									
									<button  type="button" class="am-btn am-btn-primary" id="close-button">关闭</button>									
									</div>
									<div data-am-widget="tabs" class="am-tabs am-tabs-default" data-am-tabs-noswipe="1">
										<ul class="am-tabs-nav am-cf">
											<li class="am-active"><a href="[data-tab-panel-0]">基本信息</a></li>
											<li class=""><a href="[data-tab-panel-1]">组货封面图</a></li>
											<li class=""><a href="[data-tab-panel-2]">组合商品信息</a></li>
										</ul>
										<div class="am-tabs-bd">
											<div data-tab-panel-0 class="am-tab-panel am-active" >
												<table class="am-table am-table-bordered">
													<tr>
														<td>适应客群</td>
														<td colspan="3">
															<input type="text" id="customer" name="customer" placeholder="输入适合的客群" value="${group.customer!}" style="width: 350px">
															<input type="hidden" id="groupId" name="groupId" value="${group.groupGoodsId!}">
														</td>
													</tr>
													<tr>
														<td>是否推荐</td>
														<td colspan="3">
															<div class="am-btn-group clearfix" data-am-button="">
																<label for="is_cuxiao_no"
																	class="am-btn am-btn-default"> 
																	<input type="radio" id="is_cuxiao_no" name="isRecommend" value="0"  class="am-btn am-btn-default am-active"
																	<#if (!group.isRecommend ??)||(group.isRecommend ?? && group.isRecommend==0)>checked</#if>>否
																</label> 
																<label for="is_cuxiao_yes"
																	class="am-btn am-btn-default"> <input
																	id="is_cuxiao_yes" type="radio" name="isRecommend" value="1" class="am-btn am-btn-default am-active"
																	<#if group.isRecommend ?? && group.isRecommend==1>checked</#if>>是
																</label>
															</div>
														</td>
													</tr>
												   <tr>
														<td>组货风格</td>
														<#list styleList! as style>
														<td>
														 <label style="width:65px;">${style.name+":"}</label>
															<#list style.childrenList! as child>
																<br/><label><input type="checkbox" name="style" title="${child.name!}" value="${child.name!}" <#if child.childrenList??> checked="checked" </#if> >&nbsp;${child.name!}</label>
															</#list>
														</#list>
														</td>
													</tr>
													<tr>	
														<td>组货场景</td>
														<#list sceneList! as scene>
														<td>
														  <label style="width:65px;">${scene.name+":"}</label>
															<#list scene.childrenList! as child>
																<br/><label><input type="checkbox" name="scene" title="${child.name!}" value="${child.name!}" <#if child.childrenList??> checked="checked" </#if> >&nbsp;${child.name!}</label>
															</#list>
														</#list>
														</td>
													</tr>
												</table>
											</div>
											<!-- 组货封面图 -->
										   <div data-tab-panel-1 class="am-tab-panel">
												<div class="am-form-group">
													<div class="site-upload">
														<#if group.coverImage??>
													 		<img data-img="${group.coverImage!}" class ="one-image" src="${imgUrl+group.coverImage}">
													 	<#else>
													 		<img data-img="" class ="one-image" src="${basePath}/images/default_goods.png" >
													 	</#if>
													  	<div class="site-upbar">
													  		<div class="layui-box">
													  			<form target="layui-upload-iframe" method="get" key="set-mine" enctype="multipart/form-data" action="#">
													  				 <input type="file" name="files" data-type="one" class="layui-upload-file" >
													  			</form>
													    	</div>
													 	</div>
													  	<p class="am-form-help" style="color:red;font-weight:bold;font-size:17px;">组货封面图片 宽&nbsp;&nbsp;750PX 高&nbsp;&nbsp;750PX</p>
													</div>
												</div>
												<!-- 详细文本框 -->
												<div class="am-form-group">
													<label for="doc-ipt-email-1">详细描述</label>
													<textarea id="remark" name="remark"
														style="width: 850px; height: 400px;">${group.desc!}</textarea>
													<p class="am-form-help">组货详情中图片尺寸 宽&nbsp;&nbsp;730PX
														高&nbsp;&nbsp;N-PX</p>
												</div>
											</div>
											<!-- 组货商品 -->
											<div data-tab-panel-2 id="panel-2" class="ui-tabs-panel ui-tabs-hide" style="height:550px ;overflow:auto;" >
												<input type="button" name="btnGoodsList" id="btnGoodsList" value="增加商品" class="am-btn am-btn-success am-round">
												<table class="am-table am-table-bordered am-table-striped am-table-compact" id="tblGoodsList">
													<thead>
													<tr>
												         <th>商品封面图</th>
												         <th>商品名称</th>
												         <th>价格</th>
												         <th>操作</th>
												      </tr>
												     </thead>
													 <tbody id="goods_list">
														<#list group.goodsItemList! as goods>
														<tr>
											              	<td>
											              	<#if goods.coverImage??>
																 <img data-img="${goods.coverImage!}"  src="${imgUrl+goods.coverImage!}" height="50" width="50" />
															<#else>
																<img  src="${basePath}/images/default_goods.jpg" height="50px" width="50px"  data-toggle="modal" data-target="#imgModal"/> 
															</#if>
															</td>
											                <td><input type="text" name="goodsName" value="${goods.goodsName!}" readonly="readonly"></td>
										                    <td><input type="text" name="goodsPrice" value="${goods.goodsPrice?string('#0.00')}" readonly="readonly"></td>
										                    <td>
										                 		<button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" onclick="delThemeGoodsItem(this)"><span class="am-icon-trash-o"></span> 删除</button>
										                    </td>
									              			<input type="hidden" data-id="goodsId" name="goodsId" value="${goods.goodsId!}"/>
														</tr>
														</#list>
													</tbody>
												</table>
											</div>
										</div>
									</div>
								</form>
							</td>
						</tr>
					</table>
				</div>
			</div>
		</div>
		<!-- content end -->
	</div>
	<script type="text/javascript">
		var basePath="${basePath}";
		var imgUrl = "${imgUrl}";
	</script>
</body>
</html>
